//
// Created by maicss on 22-4-18.
//

#include "TitleBar.h"
#include <QLayout>
#include <QLabel>
#include <QPushButton>
#include <QApplication>
TitleBar::TitleBar() {
    setFixedHeight(42);
    auto *layout = new QHBoxLayout;
    auto *title = new QLabel;
    title->setFont(QFont("",18));
    title->setText("FolderShare");
    layout->addWidget(title);
    m_btn_close = new QPushButton;
    layout->addStretch();
    layout->addWidget(m_btn_close);
    setLayout(layout);
    m_btn_close->setFixedSize(22,22);
    m_btn_close->setStyleSheet("QPushButton {"
                               "background-color: #0B64FF;"
                               "border-radius: 11px;"
                               "border: 1px solid #FFF"
                               "}"
                               "QPushButton::hover {"
                               "background-color: #FF3B3B;"
                               "}");
    connect(m_btn_close,&QPushButton::clicked,[=](){
        QApplication::exit(0);
    });

}
